<template>
  <div>
    <van-nav-bar fixed title="品牌列表" left-arrow @click-left="onClickLeft" />
    <div :style="{height: '45px'}"></div>
    <template v-for="(item, index) in list">
      <div class="brand-item" :key="index">
        <van-divider content-position="left">{{ item.name }}</van-divider>
        <div class="brand-img">
          <img :src="item.picUrl" alt="" />
        </div>
        <van-cell
          :title="item.desc"
          :value="item.floorPrice + '.00起'"
          value-class="brand-price"
        />
      </div>
      <!-- <img :src="item.picUrl" alt="" :key="index"> -->
    </template>
  </div>
</template>

<script>
import { NavBar, Divider, Cell } from "vant";
import { getBrandList,getBrandDetail } from "@/network";
export default {
  name: "Brand",
  data() {
    return {
      list: [],
      loading: false,
      finished: false,
    };
  },
  components: {
    [NavBar.name]: NavBar,
    [Divider.name]: Divider,
    [Cell.name]: Cell,
  },
  methods: {
    onClickLeft() {
      this.$router.back();
    },
    async getBrands() {
      const {
        data: { data },
      } = await getBrandList();
      const res = await getBrandDetail({id:'1022000'});
      console.log(res);
      this.list = data.list;
    },
  },
  created() {
    this.getBrands();
  },
  mounted() {},
};
</script>

<style lang="less" scoped>
.brand-item {
  width: 100%;
  .brand-img {
    width: 100%;
    img {
      width: 100%;
    }
  }
}
.brand-price {
  color: red;
}
</style>

